package com.neborosoft.FlyingDog.android.playing.modes;

import android.app.Activity;
import com.neborosoft.FlyingDog.logic.search.suggestions.SuggestionsProvider;
import com.neborosoft.android.gui.wrappers.ListViewSwitcher;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: CM
 * Date: 02.01.13
 * Time: 15:53
 * To change this template use File | Settings | File Templates.
 */
public abstract class PlayingModeWithSuggestions extends PlayingMode{
    private SuggestionsProvider suggestionsProvider;

    protected abstract SuggestionsProvider createSuggestionsProvider();

    protected PlayingModeWithSuggestions(Activity activity, ListViewSwitcher listViewSwitcher) {
        super(activity, listViewSwitcher);
        suggestionsProvider = createSuggestionsProvider();
    }

    protected SuggestionsProvider getSuggestionsProvider() {
        return suggestionsProvider;
    }

    @Override
    public List<String> getSearchSuggestions(String query) {
        return suggestionsProvider.getSuggestions(query);
    }
}
